using FluentNHibernate.AutoMap;
using Webshop20.Domain.Common;
using Webshop20.Domain.Stock.Core;
using Webshop20.Infrastructure.Persistence.NH.AutoMappings.Conventions.Common;

namespace Webshop20.Infrastructure.Persistence.NH.AutoMappings
{
    public class ForStock
    {
        public static AutoPersistenceModel GetPersistenceModel()
        {
            return
    AutoPersistenceModel.MapEntitiesFromAssemblyOf<Good>()
        .Where(x => x.Namespace == "Webshop20.Domain.Stock.Core")
        .ConventionDiscovery.AddFromAssemblyOf<IdConvention>()
        .WithSetup(
                                convention =>
                                {
                                    convention.IsBaseType = bt => bt == typeof(Entity);
                                    
                                }
                                    );
            
        }
    }
}